package com.tchintech.pay.adapter;

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * Created by Administrator on 2017/7/12 0012.
 * 设置recycle的上下左右间距一致
 */

public class SpaceBaseItemDecoration extends RecyclerView.ItemDecoration  {


    private int space;

    public SpaceBaseItemDecoration(int space) {
        this.space = space;
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        RecyclerView.LayoutManager layoutManager = parent.getLayoutManager();
        outRect.top = space;
        outRect.left = space;
        outRect.right = space;
        outRect.bottom = space;

    }
}





